$(document).ready(function(){
	$._messengerDefaults = {
		extraClasses: 'messenger-fixed messenger-theme-future messenger-on-top'
	}
	$('.disabled').click(function(){
		return false;
	});
	$('#headerSearch').submit(function(){
		var key = $.trim($('#headerSearch input:text').val());
		if (key == ''){
			$.globalMessenger().post({
				message: '请输入要搜索的内容。',
				showCloseButton: true
			});
			return false;
		}
	});
	
	$('.followUs .weixin a').click(function(){
		mAlert('微信关注我们','请使用微信扫描下面的二维码：<br><br><p align="center"><img src="./ui/imgs/followUs-weixin-step.jpg" /></p>');
		return false;
	});
	
	//login();
});


function login(){
	var o = $('#myModal .modal-body');
	o.html('');
	$('#myModalLabel').html('登录豪礼中国');
	o.addClass('loading');
	$('#myModal').modal();
	$.get('./ajax.php', {'t':(Math.random(100000)), 'page':'login'}, function(r){
		o.removeClass('loading').html(r);
	})
}

function mAlert(t,m){
	var o = $('#myModal .modal-body');
	o.html(m);
	$('#myModalLabel').html(t);
	$('#myModal').modal();
}